package com.sim.storage.enums

enum class TerminalParameter(val code: String, val parameterName: String) {
    CODE_P1("P1", "Terminal ID"),
    CODE_P2("P2", "Merchant ID"),
    CODE_P3("P3", "Software Release Version"),
    CODE_P4("P4", "NETS Primary Phone Number"),
    CODE_P5("P5", "NETS Secondary Phone Number"),
    CODE_P6("P6", "PABX"),
    CODE_P7("P7", "DHCP"),
    CODE_P8("P8", "Terminal IP Address"),
    CODE_P9("P9", "Terminal Gateway IP Address"),
    CODE_PA("PA", "Terminal Subnet Mask"),
    CODE_PB("PB", "Ethernet Secure Layer"),
    CODE_PC("PC", "NETS Host IP Address"),
    CODE_PD("PD", "NETS Host Port"),
    CODE_PE("PE", "Communication Type");

    companion object {
        fun fromCode(code: String): TerminalParameter {
            return TerminalParameter.values().find { it.code == code }
                ?: throw IllegalArgumentException("Unknown code: $code")
        }
    }
}